<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTradingAccountWorkflowsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('trading_account_workflows', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->unsigned()->comment('用户id');
            $table->integer('coin_id')->unsigned()->nullable()->default(null)->comment('币种id');
            $table->unsignedTinyInteger('account_type')->default(1)->comment('账户类型: 1:总账户 2:法币账户 3:币币账户 4:活动账户');
            $table->unsignedTinyInteger('op_type')->default(1)->comment('操作类型: 1:系统充值 2:系统扣除');
            $table->decimal('number', 20, 8)->unsigned()->default(0)->comment('数量');
            $table->unsignedTinyInteger('status')->default(0)->comment('状态: 0:申请修改可用余额 1:审核同意 2:审核不同意');
            $table->timestamp('created_at')->nullable()->useCurrent()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->useCurrent()->comment('修改时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('trading_account_workflows');
    }
}
